/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("Statistical_Reports",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using VOL.Dhj.IServices;
using VOL.Dhj.IRepositories;
using VOL.Dhj.Repositories;
using VOL.Dhj.Services;

namespace VOL.Dhj.Controllers
{
    //[Route("api/Statistical_Reports")]
    public partial class Statistical_ReportsController
    {
        private readonly IStatistical_ReportsService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;        



        [ActivatorUtilitiesConstructor]
        public Statistical_ReportsController(
            IStatistical_ReportsService service,
            IHttpContextAccessor httpContextAccessor            
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;            
        }

        //存入每日签到接口
        [Route("DailyAttendance"),HttpGet]
        public IActionResult DailyAttendance() {
            try
            {
               _service.DailyUpdates();                

                return Json("更新成功");
            }
            catch (Exception ex)
            {
                return Json(ex.Message);
            }

           
        }
    }
}
